# -*- mode: snippet -*-
# name: grouped bar plot - matplotlib
# key: matplotlib.bar.grouped
# contributor: Shuguang Sun
# --
# -*- coding: utf-8 -*-
fig, ax = plt.subplots()
$0rects1 = ax.bar(x - width/2, men_means, width, label='Men')
rects2 = ax.bar(x + width/2, women_means, width, label='Women')

# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(x)
ax.set_xticklabels(labels)
ax.legend()

ax.bar_label(rects1, padding=3)
ax.bar_label(rects2, padding=3)

fig.tight_layout()

plt.show()